# Maintainer: Anatol Pomozov

pkgname=aws-c-event-stream
pkgver=0.2.20
pkgrel=1
pkgdesc='C99 implementation of the vnd.amazon.eventstream content-type'
arch=(loong64 x86_64)
url='https://github.com/awslabs/aws-c-event-stream'
license=(Apache)
depends=(aws-c-common aws-checksums aws-c-io)
makedepends=(cmake)
source=(aws-c-event-stream-$pkgver.zip::https://github.com/awslabs/aws-c-event-stream/archive/v$pkgver.zip)
sha256sums=('3627d6d912a73810b4cde60c7339727228420bf6d5ead8e53e32748a85c32108')

build() {
  cd aws-c-event-stream-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -S . -B build
  cmake --build build
}

check() {
  cd aws-c-event-stream-$pkgver
  cmake --build build --target test
}

package() {
  cd aws-c-event-stream-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
